home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / boards / opal / op23b_020.lha / OpalVision / Arexx.doc next >
Text File  |  1994-04-22  |  60KB  |  2,098 lines

  1.          ARexx functions for OpalPaint - Updated for OpalPaint v2.3.
  2.  
  3.  
  4.                 opal technology pty ltd (c) 1992
  5.  
  6. INTRODUCTION
  7.  
  8.  
  9.                         ARexx Overview
  10.  
  11. To  quote  from  the  Amiga  Version  2.0 System Documentation, Chapter 10,
  12. "ARexx is a programming language designed to offer flexibility to customise
  13. your  working  environment.   ARexx  acts  as  a  central hub through which
  14. applications  may  send  data  and  commands  to  each  other.  This allows
  15. software  created  by  different companies to interact and, in turn, allows
  16. the  user  to  create  custom  applications  by  integrating  off-the-shelf
  17. software products."
  18.  
  19. Please  see  Chapter  10 of your Amiga Version 2.0 documentation, or if you
  20. purchased  ARexx  for  your  Version  1.3  see  the  included manual, for a
  21. complete  discussion  of  installing  and using ARexx.  In this document we
  22. will only discuss how OpalPaint interacts with ARexx.
  23.  
  24. Also  note that the Opal HotKey program acts as an ARexx host so that other
  25. programs  running  in  the  Amiga  environment  can access functions of the
  26. OpalVision.   These  functions  include all the options available using the
  27. HotKey  menu  or  function  keys.   See  the Reference Manual for a further
  28. description of OpalHotKey ARexx support.
  29.  
  30.  
  31.  
  32.                         Writing Scripts
  33.  
  34. You  can  create  and edit ARexx scripts using any Amiga text-based editor.
  35. Note  that  if  you  use  a  word-processor  you  will have to save it as a
  36.  text-only   or   ASCII  file.   If ARexx is generating error messages for
  37. command  arguments, try enclosing the arguments in quotes, this will happen
  38. if  you try to use negative numbers as parameters (Arexx interprets the '-'
  39. sign as a subtraction operator).  e.g.
  40.  
  41.         SetDrawMode 9 -20       Doesn't work
  42.         SetDrawMode "9 -20"     Works
  43.  
  44. The  spellings  colour  and  color  are  interchangeable in OpalPaint ARexx
  45. commands.  For example, ColourSource is equivalent to ColorSource.
  46.  
  47. Also  note  that where a command accepts a text Message string it will also
  48. accept the '\n' sequence to signify a new line.  This allows multiple lines
  49. of text to be displayed in the requester.
  50.  
  51. E.g. to display 3 lines of text, use
  52.  
  53.         Okay "This is line 1 \nThis is line 2 \nWow!!!! Isn't this fun!!!"
  54.  
  55. Note  that if you wish to include a single quote in the Message string then
  56. use double quotes at the beginning and end, and visa versa.  ARexx attempts
  57. to match quotes to determine where the string begins and ends.
  58.  
  59.  
  60.                         Filenames
  61.  
  62. The default filename extension for OpalPaint ARexx macros is '.oprx'.
  63.  
  64. NOTE: All scripts must start with a comment.
  65.  
  66.  
  67.  
  68.                         ARexx Port
  69.  
  70. The Port name for OpalPaint is:
  71.  
  72.         OpalPaint_Rexx
  73.  
  74.  
  75.  
  76.                         Executing Scripts
  77.  
  78. There  are basically 2 ways to execute a script from within OpalPaint.  The
  79. first method is to run the script from within OpalPaint using the Amiga Key
  80. and  a  function key, or the Amiga-A ARexx requester.  The second method is
  81. to  run  the  script  externally  to  OpalPaint  using  the  CLI or another
  82. ARexx-compatible program.
  83.  
  84. Up  to 30 macros can be installed using the Amiga-a ARexx control requester
  85. with  one  macro  assigned to each function key.  Once installed each macro
  86. can  be  executed by holding down either the Amiga, Control or Alt keys and
  87. pressing  the  corresponding function key.  The current macro names will be
  88. stored  in  the  'opalpaint.prefs'  configuration  file  when  OpalPaint is
  89. exited.   A one-off ARexx command can be executed by pressing Amiga-A, this
  90. will  bring  up  a string requester enabling you to type in the name of the
  91. macro to be executed.
  92.  
  93.  
  94.                         Return Values
  95.  
  96. OpalPaint  will  return an Error (RC=10) if illegal parameters are given or
  97. if an error occurs.  For example if a script attempts to invert the stencil
  98. plane  when it doesn't exist, or if there is insufficient memory to execute
  99. a function.
  100.  
  101.  
  102.                         Setup
  103.  
  104. Every  spare  page  has  its  own  setup  information stored for it.  It is
  105. important  to remember this, any modes or gradients etc that you set up for
  106. a  page  is  local  to  that page, if the active page is changed, the setup
  107. information  will  also  be  changed.   The  setup data includes gradients,
  108. transparency  settings,  drawing  mode  and  tools,  stencil enables, Paint
  109. source,  Grid  setting,  Texture  settings, magnification, brush cut modes,
  110. line  styles, Flood fill tolerances, anti-aliasing settings, colour stencil
  111. settings, magic wand setting, paper type, alpha settings, rubthrough modes,
  112. and fill modes.
  113.  
  114.  
  115.  
  116.                         Drawing Commands
  117.  
  118. Using ARexx you cannot draw any object larger than the visible display size
  119. (even  if the page is larger).  The drawing coordinates passed to ARexx are
  120. absolute  coordinates  within  the  current page.  If a drawing function is
  121. performed  outside the current viewing area, the view will automatically be
  122. paned  to  that  section.   Therefore  as long as the object being drawn is
  123. smaller  than  the screen there will be no problem, if the object is larger
  124. OpalPaint  will  center  the  display the best that it can, and the drawing
  125. will  be  clipped to the visible area.  Note that the current magnification
  126. level will also effect the size of the object that can be drawn.  Also note
  127. that low ChipRAM (especially evident when only 1M of Chip RAM is installed)
  128. will  result  in the size of the drawing area being reduced as the Menu Bar
  129. rises up from the bottom of the screen.
  130.  
  131.  
  132.                         Symbols
  133.  
  134. In   the   following   command  descriptions  several  labels  will  appear
  135. frequently.  The meaning and acceptable range for these symbols are:
  136.  
  137.         PotNum          = Paint Pot number. Range: 1 to 260
  138.         NozzleNum       = Nozzle number (artist tool). Range: 1 to 10
  139.         PageNum         = Spare Page number. Range: 1 to Number of Open Pages
  140.         BrushNum        = CutOut brush number. Range: 1 to 3
  141.         GradNum         = Gradient number. Range: 1 to 8
  142.         DModeNum        = DrawingMode number.  Range:  1 to 18 for built in modes
  143.                           and 19 to 22 for spare (loadable) modes.
  144.         SpareNum        = Spare drawing mode number. Range: 1 to 4
  145.  
  146. NOTE: Any parameters in brackets [] are optional.
  147.  
  148. Many  commands  also have a BOOLEAN parameter.  A Boolean value is one that
  149. has  only  2  states,  True  or False.  OpalPaint treats 0 as False and any
  150. other value as True.  e.g:  A Typical command accepting a boolean value is:
  151.  
  152.         Trans 0         /* Turn transparency off */
  153.         Trans 1         /* Turn transparency on */
  154.  
  155. OpalPaint  will  also  accept  the  words  ENABLE  (=1) and DISABLE (=0) in
  156. appropriate places.  Commands will also accept other labels where noted.
  157.  
  158.  
  159.  
  160.                           Summary of Commands
  161.  
  162.                         User I/O Commands
  163. AskBool Okay AskFileName AskFont AskString AskInt GetPoint GetRect AskProp
  164.  
  165.                         Drawing Commands
  166. Line   Rectangle   SolidRect  Curve  FloodFill  Ellipse  SolidEllipse  Poly
  167. SolidPoly Point LastPoint FreeHand SolidFreeHand MagicWand ReadPixel
  168. KillMarquee MarqueeFill
  169.  
  170.                         File I/O
  171. Load Save Loader Saver AllowSaves LoadComponents SaveComponents
  172.  
  173.                         Brush Manipulation
  174. Double  DoubleX  DoubleY  Halve  HalveX  HalveY FlipX FlipY Rotate90 Rotate
  175. BendH  BendV  ShearH  ShearV  Rescale  Resize HandleCenter Handle CopyBrush
  176. ActiveBrush  RescaleMethod  BrushSize  Feather  MakeText  CutMode  PutBrush
  177. LoadBrush  SaveBrush  RectCut  EllipseCut FloodCut FreeHandCut MagicWandCut
  178. PolyCut
  179.  
  180.                         Spare Pages
  181. ClearPage  SetPage  CopyPage  MovePage SwapPage PickPage DeletePage AddPage
  182. OpenPages PageName CurrPage SecondaryPage ClonePage PageSize PageRes
  183.  
  184.                         Misc
  185. Zap  Undo  Again  Magnify  MagLevel  ColourSource  Key Refresh Busy NotBusy
  186. Version  Panic  RGBtoHSV HSVtoRGB GetPrefs SetPrefs WorkMode AntiAlias Grid
  187. TransType  Trans  WarpFactor  WarpBrush FloodType FillMode LineStyle SetPen
  188. GetPen  VideoMode Texture TextureType RubDirection RubMode CurrentFont Menu
  189. SaveSetUp RestoreSetUp CopySetUp Pan FindPixel FindNextPixel DisplayStatus
  190. DisplayPercent Pantograph Clone
  191.  
  192.                         Stencils
  193. ClearSten  SetSten  DeleteSten  InvertSten  ExcludeAll  StenEnable  ColSten
  194. MaskSten SetColSten EnableColEntry AddStencil
  195.  
  196.                         Alpha Commands
  197. AddAlpha AlphaPattern ImageToAlpha InvertAlpha DeleteAlpha
  198.  
  199.                         Draw Modes
  200. SetSpare SetDrawMode
  201.  
  202.                         Artist Tools
  203. SetATool ResetATool AToolWeight GetATool NozzleSize ActiveNozzle
  204.  
  205.                         Paper Type
  206. SetPaper SmoothPaper PaperDepth
  207.  
  208.                         Palette
  209. LoadPalette SavePalette SaveRow SetPot GetPot ActivePot SpreadPots
  210.  
  211.                         Gradients
  212. ClearColGrad  ClearTransGrad  ColourDither  TransDither  GradType GradRange
  213. ColEven   TransEven   ColReverse   TransReverse   ColGradTag   TransGradTag
  214. ActiveGrad
  215.  
  216.  
  217.  
  218.  
  219.                         DETAILED DESCRIPTIONS
  220.  
  221.  
  222.                 ActiveBrush
  223.                 Usage: ActiveBrush [BrushNum]
  224.  
  225. Returns the brush number that is currently active (1 to 3) or -1 if a brush
  226. is  currently  not  selected.   If  'BrushNum' is specified then the active
  227. brush will be set to that number (1 to 3).
  228.  
  229.  
  230.  
  231.                 ActiveGrad
  232.                 Usage: ActiveGrad [GradNum]
  233.  
  234. Returns  the  currently  active  Gradient number (1 to 8).  If 'GradNum' is
  235. specified,  it  sets the currently active gradient pair to 'GradNum'.  Note
  236. that   each   gradient  pair  contains  parallel  colour  and  transparency
  237. gradients.  GradNum must be in the range of 1 to 8.
  238.  
  239.  
  240.  
  241.                 ActiveNozzle
  242.                 Usage: ActiveNozzle [NozzleNum]
  243.  
  244. Returns  the currently active nozzle number (1 to 10), or -1 if a nozzle is
  245. currently not selected.  If 'NozzleNum' is specified, ActiveNozzle sets the
  246. specifed nozzle to be the active nozzle.
  247.  
  248.  
  249.  
  250.                 ActivePot
  251.                 Usage: ActivePot [PotNum]
  252.  
  253. Returns the active pot number, this is in the range of 1..260.  If 'PotNum'
  254. is specified then the active pot will be changed to this value.
  255.  
  256.  
  257.  
  258.                 AddAlpha
  259.                 Usage: AddAlpha
  260.  
  261. Adds an alpha channel to the current image if it doesn't exist.
  262. An alpha channel will automatically added when entering Alpha edit mode.
  263.  
  264.  
  265.  
  266.                 AddPage
  267.                 Usage: AddPage Width Height Resolution
  268.  
  269. Add  a  new  spare  page with the deminsions given by 'width' and 'height'.
  270. 'Resolution'  sets  the display resolution of the page, this parameter is a
  271. set of flags, valid flags are:
  272.  
  273.         HIRES           Hires           
  274.         INTERLACE       Interlaced 
  275.         OVERSCAN        Overscan
  276.  
  277. These flags can be added together, i.e to open a hires interlaced page, 
  278.         Resolution = HIRES INTERLACE. 
  279.  
  280.  
  281.  
  282.                 AddStencil
  283.                 Usage: AddStencil
  284.  
  285. Add a mask stencil plane to the current image if one doesn't already exist.
  286. A stencil will automatically added when entering Stencil edit mode.
  287.  
  288.  
  289.  
  290.                 Again
  291.                 Usage: Again
  292.  
  293. Repeat the last drawing operation. Same as the 'a' key.
  294.  
  295.  
  296.  
  297.                 AllowSaves
  298.                 Usage: AllowSaves [Enable|Disable]
  299.  
  300. Rexx command to disable saving.
  301.  
  302.  
  303.  
  304.                 AlphaPattern
  305.                 Usage: AlphaPattern Pattern
  306.  
  307. Choose  the  alpha  background  pattern (See the Alpha Paint Options menu).
  308. The allowable patterns are 1 to 6 or GreyScale or GrayScale.
  309.  
  310. Examples:
  311.         AlphaPattern 4
  312.         AlphaPattern GreyScale
  313.  
  314.  
  315.  
  316.                 AntiAlias
  317.                 Usage: AntiAlias Enable [Level]
  318.  
  319. The Enable parameter can be ENABLE (=1) to turn antialiasing on, or DISABLE
  320. (=0) to turn it off.  Level sets the antialiasing level to be used and must
  321. be in the range of 0 to 100.
  322.  
  323.  
  324.  
  325.                 AskBool
  326.                 Usage: AskBool Message
  327.  
  328. Creates a requester containing the 'Message' text, as well as OK and CANCEL
  329. gadgets.   The  Message  string can contain '\n' to start a new line in the
  330. text.   The return value is a boolean value indicating whether the user hit
  331. OK or CANCEL, a true value is returned if OK is hit.
  332.  
  333. Example:
  334.         AskBool 'Are you sure?'
  335.         if Result=0 then
  336.                 Okay 'I Guess not'
  337.         else
  338.                 Okay 'You are!!'
  339.  
  340.  
  341.                 AskFileName
  342.                 Usage: AskFileName Hail Path FileName
  343.  
  344. Bring  up  the  OpalVision  file  requester.   The  'Hail'  string  will be
  345. displayed  at  the  top  of the requester and the initial path and filename
  346. will be set the the values specified.
  347.  
  348. If  the user hits CANCEL, RC will be set to WARN (5) otherwise the selected
  349. filename (including) path will be returned.
  350.  
  351. This  command  will  return the selected path and filename as one string in
  352. standard AmigaDOS format.
  353.  
  354. e.g.   AskFileName 'Pick a file Images24: clowns'
  355.  
  356.  
  357.  
  358.                 AskFont
  359.                 Usage: AskFont
  360.  
  361. Bring up the font requester to allow the user to select a font.
  362.  
  363. If  the user hits CANCEL, RC will be set to WARN (5) otherwise the selected
  364. font name, size and style is returned.  An example return string would be:
  365.  
  366.         topaz 8 0
  367.  
  368. The Style value is a set of flags, with the valid flags being:
  369.  
  370.         Underlined      1
  371.         Bold            2
  372.         Italic          4
  373.  
  374. These  flags  can  be added together to get composite styles.  For example,
  375. Underlined  Bold will return the value 3, while bold italic will return the
  376. value 6.
  377.  
  378.  
  379.                 AskInt
  380.                 Usage: AskInt MinInt MaxInt Default HailText
  381.  
  382.   Brings  up  a requester containing a 'Message' text as well as string, OK
  383. and  CANCEL  gadgets.   The  Message string can contain '\n' to start a new
  384. line in the text.
  385.  
  386.   The  string  gadget  can be used to enter an integer value only, 'MinInt'
  387. and 'MaxInt' set the minimum and maximum allowable values.
  388.  
  389.   Default value will define a number that initially shows in requestor.
  390.  
  391.   If the user hits CANCEL, RC will be set to WARN (5) otherwise the entered
  392. integer value will be returned.
  393.  
  394. Example:
  395.         AskInt 0 100 20 'Enter Tolerance'
  396.  
  397.  
  398.  
  399.                 AskProp
  400.                 Usage: AskProp Min Max Default Message
  401.  
  402. This command brings up a requester containing an OK and Cancel gadgets
  403. and a proportional (slider) gadget.
  404.  
  405. 'Min'  and  'Max'  define the range of the slide, 'Default' is the starting
  406. position for the knob, and 'Message' will be displayed in the requester.
  407.  
  408. Example:
  409.         AskProp 0 100 50 'Enter Tolerance'
  410.  
  411.  
  412.  
  413.                 AskString
  414.                 Usage: AskString Message
  415.  
  416. Brings up a requester containing a 'Message' text as well as string, OK and
  417. CANCEL gadgets.  The Message string can contain '\n' to start a new line in
  418. the text.  The string gadget can be used to enter any text string.
  419.  
  420. If  the  user hits CANCEL, RC will be set to WARN (5) otherwise the entered
  421. text will be returned.
  422.  
  423. Example:
  424.         AskString 'Whats your name?'
  425.  
  426. AskString  ARexx  command now accepts a default string.  The calling format
  427. is now:
  428.  
  429.         AskString Heading Default
  430.  
  431. The  2  strings can contain spaces but need to be enclosed in quotes, ARexx
  432. strips off the first level of quotes, so the following trick has to be used
  433. to sucessfully quote the string:  e.g.
  434.  
  435. Example:
  436.         AskString "'This is the heading' 'This is the default string'"
  437.  
  438. To  Keep compatibility with the old AskString, if a string is found that is
  439. not quoted and contains spaces, the entire string is treated as the heading
  440. for the requester.
  441.  
  442.  
  443.  
  444.                 AToolWeight
  445.                 Usage: AToolWeight Weight
  446.  
  447. Set  the  weight of the current selected Artist's Tool (nozzle).  Weight is
  448. the value it should be changed to (0 to 100).
  449.  
  450.  
  451.                 BendH
  452.                 Usage: BendH Distance
  453.  
  454. Bend  the  current  cutout  brush  horizontally  by  the  number  of pixels
  455. specified by 'Distance'.
  456.  
  457.  
  458.  
  459.                 BendV
  460.                 Usage: BendV Distance
  461.  
  462. Bend  the current cutout brush vertically by the number of pixels specified
  463. by 'Distance'.
  464.  
  465.  
  466.  
  467.                 BrushSize
  468.                 Usage: BrushSize
  469.  
  470. Returns the size of the current cutout brush.  The value returned is in the
  471. form  "W  H"  with the W and H values being in pixels.  If the brush is not
  472. defined, -1 -1 is returned.
  473.  
  474.  
  475.  
  476.                 Busy
  477.                 Usage: Busy
  478.  
  479. Disable  the  menu  bar  and  changes the mouse pointer to the busy sprite.
  480. Busy  calls can be nested, i.e.  multiple Busy commands can be issued and a
  481. corresponding  number  of NotBusy commands have to be issued to restore the
  482. pointer to its normal state.
  483.  
  484.  
  485.  
  486.                 ClearColGrad
  487.                 Usage: ClearColGrad
  488.  
  489. Clears  the  colour  gradient  of  the  current  gradient  pair.   This  is
  490. equivalent to the trashcan gadget in the gradient menu.
  491.  
  492.  
  493.  
  494.                 ClearPage
  495.                 Usage: ClearPage
  496.  
  497. Clears  the  current  page to black.  Note, the verification requester that
  498. normally  appears  when  hitting the trashcan gradget on the main menu will
  499. not be displayed.
  500.  
  501.  
  502.  
  503.                 ClearSten
  504.                 Usage: ClearSten
  505.  
  506. Clears the mask stencil for the current page.
  507.  
  508.  
  509.  
  510.                 ClearTransGrad
  511.                 Usage: ClearTransGrad
  512.  
  513. Clears  the  transparency  gradient for the current gradient pair.  This is
  514. equivalent to the trashcan gadget in the gradient menu.
  515.  
  516.  
  517.  
  518.                 Clone
  519.                 Usage: Clone Enable [X Y]
  520.  
  521. Enables  or  Disables  the  Clone texture mode.  If the X Y coordinates are
  522. specified, the clone crosshairs will be positioned at this point.
  523.  
  524.  
  525.  
  526.                 ClonePage
  527.                 Usage: ClonePage [PageNum]
  528.  
  529. Add  a  new  spare  page  with  the  same  dimensions and resolution as the
  530. specified  page, if the page is not specified then the current page will be
  531. cloned.  This is equivalent to the clone gadget in the spare page menu.
  532.  
  533.  
  534.                 ColEven
  535.                 Usage: ColEven
  536.  
  537. Regularly  spaces (evens out) the colour tags in the colour gradient of the
  538. current  gradient pair.  This is equivalent to the even space gadget in the
  539. gradient menu.
  540.  
  541.  
  542.  
  543.                 ColGradTag
  544.                 Usage: ColGradTag Position R G B
  545.  
  546. Adds  a  colour  tag  to  the colour gradient in the current gradient pair.
  547. Position  specifies  the  position  of the tag within the gradient, where 0
  548. corresponds  to  the  start of the gradient (left hand of colour bar in the
  549. gradient  menu)  and  1  corresponds to the end of the gradient (right hand
  550. side).   R,G,B sets the Red Green and Blue components for the colour of the
  551. tag (0-255)
  552.  
  553. For  example to create a gradient from white through blue to red in the 5th
  554. gradient pair, use:
  555.  
  556.         ActiveGrad      5
  557.         ColGradTag      0     255  255   255
  558.         ColGradTag      0.5  0      0      255
  559.         ColGradTag      1     255  0      0
  560.  
  561.  
  562.                 ColourDither (or ColorDither)
  563.                 Usage: ColourDither Dither
  564.  
  565. Set the colour dither for the colour gradient in the current gradient pair.
  566. Dither must be in the range of 0 to 100.
  567.  
  568.  
  569.  
  570.                 ColourSource (or ColorSource)
  571.                 Usage: ColourSource Source
  572.  
  573. If   Source=PAINTPOT   set  the  colour  source  to  'paint  pot'  else  if
  574. Source=MULTICOLOUR  or  MULTICOLOR  set the colour source to 'multicolour'.
  575. These  settings  correspond  to those in the modes menu.  See the Reference
  576. Manual for a full discussion of the differences between these settings.
  577.  
  578.  
  579.  
  580.                 ColReverse
  581.                 Usage: ColReverse
  582.  
  583. Reverses the direction of the colour gradient in the current gradient pair.
  584. This is equivalent to the reverse gadget in the gradient menu.
  585.  
  586.  
  587.  
  588.                 ColSten
  589.                 Usage: ColSten Enable
  590.  
  591. The  Enable  argument  can  be  ENABLE (=1) to enable the use of the colour
  592. stencil,  else  DISABLE (=0) to disable it.  This corresponds to the colour
  593. stencil enable gadget in the stencil menu.
  594.  
  595.  
  596.  
  597.                 CopyBrush
  598.                 Usage: CopyBrush SourceBrushNum
  599.  
  600. Copy the source brush (1 to 3) to the current selected cutout brush.
  601.  
  602.  
  603.  
  604.                 CopyPage
  605.                 Usage: CopyPage SrcPageNum DestPageNum [Xoffset Yoffset]
  606.  
  607. Copies  the  contents of the source page to the destination page.  If the X
  608. and Y offset are specified, the source image will be shifted by that offset
  609. when  it  is copied into the destination page.  The size of the destination
  610. page will not be modified.
  611.  
  612. If  the  offsets  are not specified, the command will copy the current page
  613. into  the  destination  page,  resizing the destination page if its not the
  614. same  as  the  source.   This is equivalent to the Copy gadget in the spare
  615. page requester.
  616.  
  617.  
  618.  
  619.                 CopySetUp
  620.                 Usage: CopySetUp DestPageNum
  621.  
  622. Copies  the  setup  of  the  current page to the destination page.  See the
  623. description of 'SetUp' above.
  624.  
  625.  
  626.  
  627.                 CurrentFont
  628.                 Usage: CurrentFont
  629.  
  630. The  current  font  name,  size  and  style is returned.  An example return
  631. string would be:
  632.  
  633.         topaz 8 0
  634.  
  635. See AskFont for details on the format of this string.
  636.  
  637.  
  638.  
  639.                 CurrPage
  640.                 Usage: CurrPage
  641.  
  642. Return the current page number.
  643.  
  644.  
  645.  
  646.                 Curve
  647.                 Usage: Curve X1 Y1 X2 Y2 X3 Y3
  648.  
  649. Draw a curve between the three points.
  650.  
  651.  
  652.  
  653.                 CutMode
  654.                 Usage: CutMode BGMode [Alpha [HTol STol VTol Smooth]]
  655.  
  656. This mode sets the options in the brush cut menu.
  657. Allowable values for BGMode are:
  658.  
  659.         NORMAL  
  660.         COLOUR or COLOR
  661.         TOLERANCE   
  662.  
  663. If  Alpha  is  ENABLE  (=1),  the  alpha  channel will be enabled for brush
  664. cutting.   If HTol, STol, VTol and Smooth are specified, the cut tolerances
  665. and  smooth  factor will be set to these values.  Htol, STol, VTol & Smooth
  666. must be in the range 0 to 100%
  667.  
  668.  
  669.  
  670.                 DeleteAlpha
  671.                 Usage: DeleteAlpha
  672.  
  673. Deletes the alpha channel for the current image.
  674.  
  675.  
  676.  
  677.                 DeletePage
  678.                 Usage: DeletePage PageNum
  679.  
  680. Delete  the  specified  page.  Equivalent to the Delete button in the Spare
  681. Pages Menu.
  682.  
  683.  
  684.  
  685.                 DeleteSten
  686.                 Usage: DeleteSten
  687.  
  688. Delete the mask stencil plane from the current image if one exists.
  689.  
  690.  
  691.  
  692.                 DisplayPercent
  693.                 Usage: DisplayPercent Current Max Text
  694.  
  695. This  command  will  display  'text'  as  well as a percentage count on the
  696. status  bar in the main menu.  'Current' can range from 0 to 'Max'.  Max is
  697. the  number of steps in an operation, and Current is the current step.  For
  698. example if you have a function that takes 6 steps, you can use:
  699.  
  700.         DisplayPercent 3 6 'Scaling:'
  701.  
  702. OpalPaint  will  determine the percentage by calculating Current/Max * 100.
  703. In the example above, 50% would be displayed.  'Text' cannot be longer than
  704. 7 characters.
  705.  
  706.  
  707.  
  708.                 DisplayStatus
  709.                 Usage: DisplayStatus Text
  710.  
  711. This  command  will  print  'Text'  into  the  status bar on the main menu.
  712. 'Text' cannot be longer than 11 characters.
  713.  
  714.  
  715.  
  716.                 Double
  717.                 Usage: Double
  718.  
  719. Double the current cutout brush size both horizontally and vertically.
  720.  
  721.  
  722.  
  723.                 DoubleX
  724.                 Usage: DoubleX
  725.  
  726. Double the current cutout brush size horizontally only.
  727.  
  728.  
  729.  
  730.                 DoubleY
  731.                 Usage: DoubleY 
  732.  
  733. Double the current cutout brush size vertically only.
  734.  
  735.  
  736.  
  737.                 Ellipse
  738.                 Usage: Ellipse Xc Yc a b
  739.  
  740. Draw  an  ellipse  centered around Xc,Yc with a horizontal dimension of 'a'
  741. and  a vertical dimension of 'b'.  To draw a circle, set 'a' and 'b' to the
  742. same value.
  743.  
  744.  
  745.  
  746.                 EllipseCut
  747.                 Usage: EllipseCut Xc Yc a b
  748.  
  749. Perform  an  elliptical  brush  cut centered around Xc,Yc with a horizontal
  750. dimension of 'a' and a vertical dimension of 'b'.  To cut a circle, set 'a'
  751. and  'b'  to  the  same  value.  The cutout will be placed in the currently
  752. selected cutout brush (1 to 3).
  753.  
  754.  
  755.  
  756.                 EnableColEntry
  757.                 Usage: EnableColEntry ColEntry Enable
  758.  
  759. Enable or disable a colour stencil entry.  'ColEntry' is the colour stencil
  760. to be modified (between 1 and 6).  The Enable argument can be either ENABLE
  761. (=1) to Enable the stencil entry or DISABLE (=0) to disable it.
  762.  
  763.  
  764.  
  765.                 ExcludeAll
  766.                 Usage: ExcludeAll Enable
  767.  
  768. Sets  or  clears  the  ExcludeAll  gadget  in the stencil menu.  The Enable
  769. argument  can be either ENABLE (=1) to Exclude all colours in the image, or
  770. DISABLE  (=0)  to  Include  all colours by default.  See the section in the
  771. OpalVision  Reference Manual on Stencil Priority for further details of how
  772. stencils are combined and how priorities are determined.
  773.  
  774.  
  775.  
  776.                 Feather
  777.                 Usage: Feather Radius
  778.  
  779. Feather  the  current  cutout  brush  using  the  radius  given.  Radius is
  780. measured in pixels.
  781.  
  782.  
  783.  
  784.                 FillMode
  785.                 Usage: FillMode Mode
  786.  
  787. Set the current fill mode, the allowable values for 'mode' are:
  788.  
  789.         SOLID           = Solid fill
  790.         GRADIENT        = Gradient fill
  791.         BRUSH           = Brush warp fill
  792.  
  793.  
  794.  
  795.                 FindNextPixel
  796.                 Usage: FindNextPixel
  797.  
  798.   This  command  should  be  called  only  after  FindPixel.   Returns  the
  799. coordinates  of the next pixel matching the colour given in FindPixel.  '-1
  800. -1'  is  returned  if  no  pixels  are  found.  FindNextPixel can be called
  801. repeatedly until it returns '-1 -1'.
  802.  
  803.  
  804.  
  805.                 FindPixel
  806.                 Usage: FindPixel R G B
  807.  
  808.   Returns the coordinates of the first pixel encountered which has a colour
  809. value  matching  'R G B'.  Search starts at the top-left hand corner of the
  810. image.
  811.  
  812.  
  813.  
  814.                 FlipX
  815.                 Usage: FlipX
  816.  
  817. Flip the current cutout brush horizontally.
  818.  
  819.  
  820.  
  821.                 FlipY
  822.                 Usage: FlipY
  823.  
  824. Flip the current cutout brush vertically.
  825.  
  826.  
  827.  
  828.                 FloodCut
  829.                 Usage: FloodCut X Y
  830.  
  831. Cut  a  brush  using a flood fill.  The fill will start at X,Y.  The cutout
  832. will be placed in the currently selected cutout brush (1 to 3).
  833.  
  834.  
  835.  
  836.                 FloodFill
  837.                 Usage: FloodFill X Y
  838.  
  839. Start a flood fill at X,Y.
  840.  
  841.  
  842.  
  843.                 FloodType
  844.                 Usage: FloodType Type [HTol STol VTol]
  845.  
  846. Set the current flood fill options. Allowable values for type are:
  847.  
  848.         NORMAL          = Normal fill
  849.         TOLERANCE       = Tolerance fill
  850.  
  851. If  HTol,STol  and  VTol  are  specified the fill tolerances will be set to
  852. these values.  Htol, STol & VTol must be in the range 0 to 100%
  853.  
  854.  
  855.  
  856.                 FreeHand
  857.                 Usage: FreeHand [X Y X Y ....]
  858.  
  859. Start  freehand  drawmode.   If coordinates are specified a continuous line
  860. will be drawn between the coordinates.  This command is used in conjunction
  861. with  the  Point and LastPoint commands.  Note that for cutting, PolyCut is
  862. the  equivalent of FreeHandCut, so FreeHandCut has not been included in the
  863. command set.
  864.  
  865.  
  866.  
  867.                 FreeHandCut
  868.                 Usage: FreeHandCut [X Y X Y ...]
  869.  
  870. Start  a  FreeHand cut into the current selected cutout brush.  The vertice
  871. parameters  are the same as the Poly command.  This command is functionally
  872. identical  to  the PolyCut command and has been added only for consistency.
  873. Note that the filled polygon gadget will be highlighted after this command.
  874. The  cutout will be placed in the currently selected cutout brush (1 to 3).
  875.  
  876.  
  877.  
  878.                 GetATool
  879.                 Usage: GetATool NozzleNum
  880.  
  881. Returns  the artists tool name for the specified nozzle.  NozzleNum must be
  882. in the range (1 to 10)
  883.  
  884.  
  885.  
  886.                 GetPen
  887.                 Usage: GetPen
  888.  
  889. Returns the colour of the current selected paintpot in R G B format.
  890.  
  891.  
  892.  
  893.                 GetPoint
  894.                 Usage: GetPoint
  895.  
  896. Ask  the  user  to  select  a  point  on  the  image.  When this command is
  897. executed,  the  mouse  pointer  changes to 'Point' and waits until the user
  898. selects a point using the mouse.  The coordinates of the selected point are
  899. returned  in X Y form relative to the top left corner of the image, NOT the
  900. position within the visible painting area.
  901.  
  902.  
  903.  
  904.                 GetPot
  905.                 Usage: GetPot PotNum
  906.  
  907. Returns the colour of the specified paint pot.  The colour is returned in
  908. R G B format.
  909.  
  910.  
  911.  
  912.                 GetPrefs
  913.                 Usage: GetPrefs
  914.  
  915. Returns  the  current  preferences  settings.   A single number is returned
  916. specifying  the  active  preferences,  the  number is made up of flags, the
  917. current valid flags are:
  918.  
  919.         1       = Don't save thumbnails.
  920.         2       = Do safe file writes.
  921.         4       = Unused Spare pages -> Disk.
  922.         8       = Unused brushes -> Disk.
  923.         16      = Outside of work area -> Disk.
  924.         32      = Fast feed back on.
  925.         64      = drag rectangles from center.
  926.         128     = drag circles from center.
  927.         256     = Don't save icons.
  928.         512     = Rectangles/circles aspect correct (be square).
  929.         1024    = Don't calculate brush outlines.
  930.         2048    = Don't Load setup struct with Image.
  931.         4096    = Allow brush build up.
  932.         8192    = Don't raise menu bar in overscan mode.
  933.         16384   = Disable tablet pen flicks.
  934.  
  935. To test if a particular mode is set, use the ARexx logical AND operator,
  936. e.g.:
  937.         Prefs = GetPrefs
  938.         if (Prefs & 32) then FastFeedBack = 1
  939.  
  940.  
  941.  
  942.                 GetRect
  943.                 Usage: GetRect
  944.  
  945. Ask  the user to select a rectangular area of the image.  When this command
  946. is  executed,  the mouse pointer changes to 'Rect' and waits until the user
  947. drags  out  a  rectangle.   Once the rectangle has been selected, the upper
  948. left  and lower right coordinates of the rectangle are returned in X1 Y1 X2
  949. Y2 form.
  950.  
  951.  
  952.  
  953.                 GradRange
  954.                 Usage: GradRange X1 Y1 X2 Y2
  955.  
  956. This  command  is  used to specify the gradient range for the 'Linear Free'
  957. and 'Radial Free' gradient modes.  Normally OpalPaint asks the user to drag
  958. out  a  line  or  ellipse  when  these gradient modes are used, under ARexx
  959. control  however  this  command  is  used  instead, to specify the gradient
  960. range.   Note  that this command must be specified before the filled object
  961. is drawn.
  962.  
  963. e.g To draw a circle with a 45 degree angle gradient across it.
  964.  
  965.         GradType LinearFree HSV /* Set up 'linear free' mode */
  966.         GradRange 120 90 180 150
  967.         SolidEllipse 150 120 30 30
  968.  
  969.  
  970.  
  971.                 GradType
  972.                 Usage: GradType Type [ColourSystem]
  973.  
  974. Setup  the  gradient  type options.  'Type' specifies one of the 6 possible
  975. gradient types in the gradient menu.  Allowable values for 'type' are:
  976.  
  977.         HORIZONTAL      = Horizontal Gradient
  978.         VERTICAL        = Vertical Gradient
  979.         RADIAL          = Radial Gradient
  980.         HORIZONTALFIT   = Horizontal Fit gradient.
  981.         LINEARFREE      = Linear Free Gradient
  982.         RADIALFREE      = Radial Free Gradient.
  983.  
  984. Types  LINEARFREE  and RADIALFREE must also be used in conjunction with the
  985. GradRange command.
  986.  
  987. If the 'ColourSystem' argument is specified, allowable values are 
  988.         RGB     = RGB colour mode
  989.         HSV     = HSV colour mode
  990.  
  991.  
  992.  
  993.                 Grid
  994.                 Usage: Grid Enable [W H [X Y]]
  995.  
  996. Enable  is  used  to  turn the Grid on/off.  If the argument is ENABLE (=1)
  997. grid  is  enabled,  else  if  DISABLE  (=0) it is disabled.  If W and H are
  998. specified,  the  grid  spacing  is  set  to  these  values.  If X and Y are
  999. specified, the grid origin is moved to that location.
  1000.  
  1001.  
  1002.  
  1003.                 Halve
  1004.                 Usage: Halve
  1005.  
  1006. Halve the current cutout brush size both horizontally and vertically.
  1007.  
  1008.  
  1009.  
  1010.                 HalveX
  1011.                 Usage: HalveX
  1012.  
  1013. Halve the current cutout brush size horizontally.
  1014.  
  1015.  
  1016.  
  1017.                 HalveY
  1018.                 Usage: HalveY
  1019.  
  1020. Halve the current cutout brush size vertically.
  1021.  
  1022.  
  1023.  
  1024.                 Handle
  1025.                 Usage: Handle X Y
  1026.  
  1027. Move the brush handle to location X,Y within the brush.
  1028. e.g.
  1029.         ActiveBrush 1   /* Set the current cutout brush to B1 */
  1030.         Handle 0 0      /* Handle to top left on brush 1 */
  1031.         BrushSize
  1032.         Handle Result   /* Handle to bottom right on brush 1 */
  1033.  
  1034.  
  1035.  
  1036.                 HandleCenter
  1037.                 Usage: HandleCenter
  1038.  
  1039. Center the handle within the current cutout brush.
  1040.  
  1041.  
  1042.  
  1043.                 HSVtoRGB
  1044.                 Usage: HSVtoRGB H S V
  1045.  
  1046. Convert  a  colour  specified  in  the  HSV colour system to the RGB colour
  1047. system.  HSV values range from 0 to 65535, i.e.
  1048.  
  1049. Actual Value     0             65535
  1050. --------------------------------------
  1051. Hue             0 degrees    359 degrees
  1052. Saturation      0%             100%
  1053. Value           0%             100%
  1054.  
  1055. RGB values range from 0 to 255.
  1056.  
  1057.  
  1058.  
  1059.                 ImageToAlpha
  1060.                 Usage: ImageToAlpha
  1061.  
  1062. Copies the current image into it's own alpha channel.
  1063.  
  1064.  
  1065.  
  1066.                 InvertAlpha
  1067.                 Usage: InvertAlpha
  1068.  
  1069. Inverts the contents of the alpha channel.
  1070.  
  1071.  
  1072.  
  1073.                 InvertSten
  1074.                 Usage: InvertSten
  1075.  
  1076. Invert the mask stencil for the current image.
  1077.  
  1078.  
  1079.  
  1080.                 Key
  1081.                 Usage: Key [[Qualifiers] Character] [KeyFileToken]
  1082.  
  1083. Process a key as if it was typed on the keyboard.  The allowable qualifiers
  1084. are:
  1085.  
  1086.         AMIGA
  1087.         ALT
  1088.         CONTROL
  1089.         SHIFT
  1090.  
  1091. The qualifiers may be freely mixed, e.g. CONTROL SHIFT is acceptable.
  1092.  
  1093. 'Character'  can  either be a single character or a name for an unprintable
  1094. character.  The accepted key names are:
  1095.  
  1096.         LEFTARROW       = Left Arrow key
  1097.         RIGHTARROW      = Right Arrow key
  1098.         UPARROW         = Up Arrow Key
  1099.         DOWNARROW       = Down Arrow Key
  1100.         HELP            = Help Key
  1101.         DEL             = Delete key
  1102.         F1 to F10       = Function keys.
  1103.  
  1104. e.g.
  1105.         key 'ALT SHIFT LEFTARROW'       /* Rip up and Redo to left*/
  1106.  
  1107.    With  the  addition  of keyfiles in OpalPaint v2.3, this method of using
  1108. keystokes  for  commands is no longer reliable if the ARexx script is to be
  1109. used  by  different  users.   This is due to the fact that the user can now
  1110. redefine the keyboard equivalents and hence you cannot assume that, Amiga Q
  1111. for instance, will quit OpalPaint.
  1112.  
  1113.   To get around this problem, the 'key' command now accepts the same tokens
  1114. that  are  used in the key file to define the keyboard command, for example
  1115. to quit OpalPaint, the following command can be used:
  1116.  
  1117.         Key Quit
  1118.  
  1119.   It  is suggested that you always use this format of the key command.  All
  1120. the    available   command   tokens   are   defined   in   the   key   file
  1121. OpalPaint:Prefs/OpalPaint.keys.
  1122.  
  1123.  
  1124.  
  1125.                 KillMarquee
  1126.                 Usage: KillMarquee
  1127.  
  1128. Terminate the current Marquee without filling it.
  1129.  
  1130.  
  1131.  
  1132.                 LastPoint
  1133.                 Usage: LastPoint [X Y X Y...]
  1134.  
  1135. This  command  is  used  to finish the drawing or cutting using freehand or
  1136. polygon  modes.   To  draw  or  cut  freehand or a polygon, first enter the
  1137. correct  drawing  mode,  specify  the  points  for  drawing using Point and
  1138. complete the object using last point.
  1139. e.g.
  1140.  
  1141.         FreeHand X1 Y1
  1142.         Point  X2 Y1 X2-10 Y1+10 X1+10 Y1+10
  1143.         LastPoint X1 Y1
  1144.  
  1145.  
  1146.                 Line
  1147.                 Usage: Line X1 Y1 X2 Y2
  1148.  
  1149. Draw a line between point 1 (X1,Y1) and point 2 (X2,Y2).
  1150.  
  1151.  
  1152.  
  1153.                 LineStyle
  1154.                 Usage: LineStyle Style [Dots]
  1155.  
  1156. Set the current line style. Allowable values of 'style' are:
  1157.  
  1158.         CONTINUOUS      = Continuous
  1159.         SPACED          = Every Nth
  1160.         TOTAL           = Total Dots
  1161.  
  1162. If  Style  =  SPACED  then 'Dots' specifies the spacing between dots on the
  1163. line.   If  Style = TOTAL, 'Dots' specifies the total number of dots making
  1164. up the line.
  1165.  
  1166.  
  1167.  
  1168.                 Load
  1169.                 Usage: Load FileName
  1170.  
  1171. Load  a file using the current loader.  FileName must include the full path
  1172. of the image name.
  1173.  
  1174.  
  1175.  
  1176.                 LoadBrush
  1177.                 Usage: LoadBrush FileName
  1178.  
  1179. Load 'Filename' into the current selected cutout brush (1 to 3).
  1180.  
  1181.  
  1182.  
  1183.                 LoadComponents
  1184.                 Usage: LoadComponents [Components]
  1185.  
  1186. Specify  the  image  components  which  are  loaded (as set in the 'Image',
  1187. 'Stencil'  and  'Alpha'  buttons  in  the  VLSI  requestor).  The allowable
  1188. parameters are 'Image', 'Alpha' and 'Stencil' which can be specified in any
  1189. combination and order.
  1190.  
  1191. e.g. To load all image components:
  1192.  
  1193.         LoadComponents Image Stencil Alpha
  1194.  
  1195.  
  1196.                 Loader
  1197.                 Usage: Loader Name [Parameters]
  1198.  
  1199. Set  the  current  image loader.  Allowable names for v2.3 of OpalPaint are
  1200. Intelligent, IFF, FAST, JPEG, GIF, Rendition and VPB.  'Parameters' will be
  1201. local  to  each  loader,  and  these  values will be passed directly to the
  1202. loader.  For example, the JPEG saver parameter is a quality factor.
  1203.  
  1204.  
  1205.                 LoadPalette
  1206.                 Usage: LoadPalette FileName
  1207.  
  1208. Load  a  new  palette  set.  If the saved palette was a complete set of 260
  1209. paint pots then all paint-pots will be replaced.  If the saved palette only
  1210. contains  a  single  paint-pot  row  then the current paint-pot row will be
  1211. replaced.   To select the row to be replaced, first select any paint-pot in
  1212. the row using the ActivePot command.
  1213.  
  1214.  
  1215.  
  1216.                 MagicWand
  1217.                 Usage: MagicWand X Y [Tolerance]
  1218.  
  1219. Start  a  Magic  Wand  fill  at X,Y (relative to the top left corner of the
  1220. image).  Tolerance must be in the range (0 to 100).
  1221.  
  1222. This  command  can  be issued several times to build up a marquee, each new
  1223. call  to MagicWand is equivalent to pressing the mouse button while holding
  1224. down  the  shift  key.   The  Marquee  generated will not be filled until a
  1225. 'MarqueeFill' command is issued.
  1226.  
  1227.  
  1228.  
  1229.  
  1230.                 MagicWandCut
  1231.                 Usage: MagicWandCut X Y [Tolerance]
  1232.  
  1233. Start  a  Magic  Wand  cut  at  X,Y (relative to the top left corner of the
  1234. image).   Tolerance  must  be  in the range (0 to 100).  The cutout will be
  1235. placed in the currently selected cutout brush (1 to 3).  The brush will not
  1236. be cut until a 'MarqueeFill' command is issued.
  1237.  
  1238.  
  1239.  
  1240.                 MagLevel
  1241.                 Usage: MagLevel Level
  1242.  
  1243. Set  the  current magnification level.  If the page is currently in magnify
  1244. mode,  the  display will be refreshed at this level.  Allowable Level's are
  1245. 1,2,4,8 (and 16 in hires only).
  1246.  
  1247.  
  1248.  
  1249.                 Magnify
  1250.                 Usage: Magnify Enable
  1251.  
  1252. The  Enable  argument  can  be ENABLE (=1) to turn magnify on, else DISABLE
  1253. (=0) to turn magnify off.
  1254.  
  1255.  
  1256.  
  1257.                 MakeText
  1258.                 Usage: MakeText Font FontSize FontStyle Text
  1259.  
  1260. Create  text  in the current cutout brush using the font specified and text
  1261. string.   The  values  for  FontStyle  are  the  same  as those returned by
  1262. AskFont.
  1263.  
  1264. e.g.
  1265.         MakeText 'cgtimes 50 2 Hello'
  1266.  
  1267.  
  1268.  
  1269.                 MarqueeFill
  1270.                 Usage: MarqueeFill
  1271.  
  1272. Fill  the  currently active marqueed area, returns an error if a marquee is
  1273. not active.  (Marquees are created using the magic wand tool).
  1274.  
  1275.  
  1276.  
  1277.                 MaskSten
  1278.                 Usage: MaskSten Enable
  1279.  
  1280. If  the  Enable  argument  is  ENABLE  (=1) then enable the use of the mask
  1281. stencil, else use DISABLE (=0) to disable it.  This corresponds to the mask
  1282. stencil enable gadget in the stencil requester.
  1283.  
  1284.  
  1285.  
  1286.                 Menu
  1287.                 Usage: Menu Enable
  1288.  
  1289. If  the Enable argument is ENABLE (=1) then display the menu/tool bar, else
  1290. use DISABLE (=0) to make the menu bar disappear.
  1291.  
  1292.  
  1293.  
  1294.                 MovePage
  1295.                 Usage: MovePage SrcPageNum DestPageNum
  1296.  
  1297. Move  the  source  page  to  the  destination  page.   This function simply
  1298. shuffles the order of spare pages around.
  1299.  
  1300.  
  1301.  
  1302.                 NotBusy
  1303.                 Usage: NotBusy
  1304.  
  1305. Disables  the  Busy  mouse  pointer and enables the menu bar.  If there are
  1306. nested  Busy  commands  this  command  will 'unest' them and not change the
  1307. mouse  pointer  until  the  number of NotBusy commands equals the number of
  1308. Busy commands executed.
  1309.  
  1310.  
  1311.  
  1312.                 NozzleSize
  1313.                 Usage: NozzleSize [W H]
  1314.  
  1315. Returns the size of the current selected nozzle.  If W and H are specified,
  1316. the size of the nozzle will be modified to this size.
  1317.  
  1318.  
  1319.  
  1320.                 Okay
  1321.                 Usage: Okay Message
  1322.  
  1323. Brings  up a requester containing the 'Message' text and an OK gadget only.
  1324. The Message string can contain '\n' to start a new line in the text.
  1325.  
  1326. e.g. Okay 'Operation complete'
  1327.  
  1328.  
  1329.  
  1330.                 OpenPages
  1331.                 Usage: OpenPages
  1332.  
  1333. Returns the number of open pages.
  1334.  
  1335.  
  1336.  
  1337.                 PageName
  1338.                 Usage: PageName [PageNum]
  1339.  
  1340. Returns  the  name  of  a  page.   If PageNum is not specified, the current
  1341. page's name will be returned.  A page is named by saving it.
  1342.  
  1343.  
  1344.  
  1345.                 PageRes
  1346.                 Usage: PageRes 
  1347.  
  1348. Returns  the  current  page resolution.  The returned value can contain any
  1349. combination of the tokens HIRES, INTERLACE and OVERSCAN (as accepted by the
  1350. AddPage and PageSize commands).
  1351.  
  1352.  
  1353.  
  1354.                 PageSize
  1355.                 Usage: PageSize [W H Modes Scale]
  1356.  
  1357. Returns  the  current  page size in W H format.  If the optional parameters
  1358. are  specified,  the page will be resized to the WxH and Modes will be used
  1359. for  the  display mode (see AddPage for description of display Modes).  The
  1360. value  of  Scale determines the way in which the page is resized.  If Scale
  1361. is  false  (=0),  the  page  is  cropped  to the new size, else the page is
  1362. rescaled to fit the new size.
  1363.  
  1364.  
  1365.  
  1366.                 Pan
  1367.                 Usage: Pan X Y
  1368.  
  1369. This  command  sets  the  X,Y  location  of the top left hand corner of the
  1370. viewing  area.   This  allows  the  displayed  to be panned around within a
  1371. larger image.
  1372.  
  1373.  
  1374.  
  1375.                 Panic
  1376.                 Usage: Panic
  1377.  
  1378. Same  as the panic button in the About requester.  Sets single-pixel brush,
  1379. continuous  draw  and  Paint  Mode.   Switches  off  all  options  such  as
  1380. transparency, stencils, textures etc.
  1381.  
  1382.  
  1383.  
  1384.                 Pantograph
  1385.                 Usage: Pantograph Enable [X Y]
  1386.  
  1387. Enables  or  Disables  the pantograph texture mode.  If the X Y coordinates
  1388. are specified, the pantograph crosshairs will be positioned at this point.
  1389.  
  1390.  
  1391.  
  1392.                 PaperDepth
  1393.                 Usage: PaperDepth Depth
  1394.  
  1395. Set the depth of the current paper type.  Depth must be between 0 and 100.
  1396.  
  1397.  
  1398.  
  1399.                 PickPage
  1400.                 Usage: PickPage PageNum
  1401.  
  1402. Change the active page to 'PageNum'.
  1403.  
  1404.  
  1405.  
  1406.                 Point
  1407.                 Usage: Point [X Y X Y ...]
  1408.  
  1409. Specify points for freehand and Polygon drawing modes. (See LastPoint)
  1410.  
  1411.  
  1412.  
  1413.                 Poly
  1414.                 Usage: Poly [X Y X Y ...]
  1415.  
  1416. Start poly drawing mode.  If the vertices are given, lines will be drawn to
  1417. the  given points.  Additional points can be given using the Point command,
  1418. and the polygon is terminated using the LastPoint command.
  1419.  
  1420.  
  1421.  
  1422.                 PolyCut
  1423.                 Usage: PolyCut [X Y X Y ...]
  1424.  
  1425. Start  a  Polygon  cut into the current selected cutout brush.  The vertice
  1426. parameters  are the same as the Poly command.  The cutout will be placed in
  1427. the currently selected cutout brush (1 to 3).
  1428.  
  1429.  
  1430.  
  1431.                 PutBrush
  1432.                 Usage: PutBrush X Y
  1433.  
  1434. Draws the currently active brush or nozzle at X,Y location given.
  1435.  
  1436.  
  1437.  
  1438.                 ReadPixel
  1439.                 Usage: ReadPixel X Y
  1440.  
  1441. Return  the  colour values of a given pixel.  The return value is the pixel
  1442. colour in R G B format.
  1443.  
  1444.  
  1445.  
  1446.                 Rectangle
  1447.                 Usage: Rectangle X1 Y1 X2 Y2
  1448.  
  1449. Draw a rectangle between Point1 (X1,Y1) and Point2 (X2,Y2).
  1450.  
  1451. Point1  defines  the  top left-hand corner of the rectangle, Point2 defines
  1452. the bottom right-hand corner.
  1453.  
  1454.  
  1455.  
  1456.                 RectCut
  1457.                 Usage: RectCut X1 Y1 X2 Y2
  1458.  
  1459. Make  a  rectangular  cut  into  the  current  cutout  brush.   The vertice
  1460. parameters  are  the  same  as Rectangle.  The cutout will be placed in the
  1461. currently selected cutout brush (1 to 3).
  1462.  
  1463.  
  1464.  
  1465.                 Refresh
  1466.                 Usage: Refresh
  1467.  
  1468. Refresh  the current display by updating the image in Amiga memory into the
  1469. OpalVision  Hardware.  This command is rarely required however as OpalPaint
  1470. will generally keep the displayed version the image consistent with that in
  1471. memory.
  1472.  
  1473. The  only time this command will be required is to update the display after
  1474. the   palette   data   has  been  changed.   OpalPaint  does  not  do  this
  1475. automatically to increase the speed of modifying palette colours.
  1476.  
  1477.  
  1478.  
  1479.                 Rescale
  1480.                 Usage: Rescale %x %y
  1481.  
  1482. Rescale the current cutout brush using percentage values.  %x and %y define
  1483. the percentage scaling for the x and y axis respectively.
  1484.  
  1485. e.g.
  1486.         ActiveBrush 2           /* Make brush B2 active */
  1487.         Rescale 50 50           /* Halve the current (B2) brush 2  */
  1488.         ActiveBrush 3           /* Make brush B3 active */
  1489.         Rescale 200 200         /* Double the current (B3) brush */
  1490.  
  1491.  
  1492.  
  1493.                 RescaleMethod
  1494.                 Usage: RescaleMethod Method
  1495.  
  1496. Set  the  rescaling  method for the current cutout brush.  Allowable values
  1497. for 'Method' are:
  1498.  
  1499.         BLOCKY  (Multiply pixels. Fastest)
  1500.         SMOOTH1 (Linear interpolation)
  1501.         SMOOTH2 (Cubic Spline interpolation. Slowest)
  1502.  
  1503.  
  1504.  
  1505.                 ResetATool
  1506.                 Usage: ResetATool
  1507.  
  1508. Reset the current nozzle to its default 'solid' state.  Has the same effect
  1509. as the Solid gadget in the Artists Tools menu.
  1510.  
  1511.  
  1512.  
  1513.                 Resize
  1514.                 Usage: Resize W H
  1515.  
  1516. Resize the current cutout brush to an absolute pixel size.
  1517.  e.g.
  1518.         ActiveBrush 2        /* Select brush B2 */
  1519.         Resize 100 100       /* Resize brush 2 to 100 by 100 pixels */
  1520.  
  1521.  
  1522.  
  1523.                 RestoreSetUp
  1524.                 Usage: RestoreSetUp
  1525.  
  1526. Restore  the setup information stored using SaveSetUp.  Note, the same page
  1527. should  be  active  as when SaveSetup was called if you wish to restore the
  1528. users  setup  back  to  the way it was before the macro was executed.  If a
  1529. different  page  is  active  the  result  will basically be the same as the
  1530. CopySetup command.
  1531.  
  1532.  
  1533.  
  1534.                 RGBtoHSV
  1535.                 Usage: RGBtoHSV R G B
  1536.  
  1537. Convert  a  colour  specified  in  the  RGB colour system to the HSV colour
  1538. system (See HSVtoRGB).
  1539.  
  1540.  
  1541.  
  1542.                 Rotate
  1543.                 Usage: Rotate Angle
  1544.  
  1545. Rotate the current brush by any angle.  'Angle' must be an integer value in
  1546. degress.
  1547.  
  1548. e.g.
  1549.         ActiveBrush 3   /* Select brush B3 as the current brush */
  1550.         Rotate 45       /* Rotate Brush 3 by 45 degrees */
  1551.  
  1552.  
  1553.  
  1554.                 Rotate90
  1555.                 Usage: Rotate90 
  1556.  
  1557. Rotate the current cutout brush 90 degrees anti-clockwise.
  1558.  
  1559.  
  1560.  
  1561.                 RubDirection
  1562.                 Usage: RubDirection Dir
  1563.  
  1564. If  'Dir'  is  false  (=0)  the  rub direction will be set to 'Secondary to
  1565. Current'   else  the  direction  will  be  'Current  to  Secondary'.   This
  1566. corresponds to the direction gadget in the spare page menu.
  1567.  
  1568.  
  1569.  
  1570.                 RubMode
  1571.                 Usage: RubMode RubType [XOffset YOffset]
  1572.  
  1573. Set RubThough mode.
  1574. Allowable values for the 'RubType' parameter are
  1575.  
  1576.         RELATIVE        = Relative rubthrough mode
  1577.         ABSOLUTE        = Absolute rubthrough mode.
  1578.  
  1579. If  'XOffset'  and  'YOffset' are specified, the rub through origin will be
  1580. set  to  that  location.   These functions correspond to the gadgets in the
  1581. spare page menu.
  1582.  
  1583.  
  1584.  
  1585.                 Save
  1586.                 Usage: Save FileName
  1587.  
  1588. Save the current image using the filename given.  The filename must include
  1589. the  full  path of the image name.  The currently active saver will be used
  1590. to perform the save.
  1591.  
  1592.  
  1593.  
  1594.                 SaveBrush
  1595.                 Usage: SaveBrush FileName
  1596.  
  1597. Save  the  current  cutout  brush in IFF format.  Filename must include the
  1598. full path of the brush file.
  1599.  
  1600.  
  1601.  
  1602.                 SaveComponents
  1603.                 Usage: SaveComponents [parameters]
  1604.  
  1605. Specify  the  image  components  which  are  saved  (as set in the 'Image',
  1606. 'Stencil'  and  'Alpha'  buttons  in  the  VLSI  requestor).  The allowable
  1607. parameters are 'Image', 'Alpha' and 'Stencil' which can be specified in any
  1608. combination and order.
  1609.  
  1610. e.g. To save all image components:
  1611.  
  1612.         SaveComponents Image Stencil Alpha
  1613.  
  1614.  
  1615.  
  1616.                 SavePalette
  1617.                 Usage: SavePalette FileName
  1618.  
  1619. Save  the  current  palette (all 260 entries) and the mixing area to an IFF
  1620. file.  FileName must include the full path.
  1621.  
  1622.  
  1623.  
  1624.                 Saver
  1625.                 Usage: Saver [Parameters]
  1626.  
  1627. Set  the  current  image  saver.  Allowable names for v2.3 of OpalPaint are
  1628. IFF,  FAST,  JPEG,  VPB  and  Rendition.   Parameters will be local to each
  1629. loader, and these values will be passed directly to the loader.
  1630.  
  1631.  
  1632.  
  1633.                 SaveRow
  1634.                 Usage: SaveRow FileName
  1635.  
  1636. Save the current Row of palette colours (20 entries) and the mixing area to
  1637. an  IFF  file.   FileName must include the full path.  To select the active
  1638. row, use ActivePot to select any paint pot within that row.
  1639.  
  1640.  
  1641.  
  1642.                 SaveSetUp
  1643.                 Usage: SaveSetUp
  1644.  
  1645. Save  the  current  Setup  information  to  a  temporary memory area.  This
  1646. includes  the  SetUp  structure  (see  description  above), the preferences
  1647. values,  the  active  paint  pot and the colour palette.  This is useful to
  1648. make   a   snapshot  of  the  users  configuration  before  performing  any
  1649. operations,   when  your  macro  exits  use  RestoreSetUp  to  restore  the
  1650. configuration  to  the  way it was.  Note, if your using this technique you
  1651. must be on the same page when you call SaveSetUp and RestoreSetUp.
  1652.  
  1653.  
  1654.  
  1655.                 SecondaryPage
  1656.                 Usage: SecondaryPage [PageNum]
  1657.  
  1658. Returns  the page number of the secondary page.  If 'PageNum' is specified,
  1659. the secondary page will be set to this page.
  1660.  
  1661.  
  1662.  
  1663.                 SetATool
  1664.                 Usage: SetATool AToolName [Weight]
  1665.  
  1666. Load an artist tool into the current nozzle.  AToolName specifies the tools
  1667. to  be  loaded, and must be the name of a file in the OpalPaint:ArtistTools
  1668. directory.  Weight specifies the initial tool weight (0 to 100).
  1669.  
  1670. e.g.
  1671.         ActiveNozzle 3          /* Select nozzle 3 to be active */
  1672.         SetATool AirBrush 50    /* Nozzle 3 = airbush at 50% */
  1673.  
  1674. NozzleNum must be in the range (1 to 10).
  1675.  
  1676.  
  1677.  
  1678.                 SetColSten
  1679.                 Usage: SetColSten StenEntry Include R G B HTol STol VTol
  1680.  
  1681. Modify  a colour stencil entry.  'StenEntry' is the entry to be modified (1
  1682. to  6).   If  'Include' is false (=0) the entry will be an Excluded colour,
  1683. else  it  will  be  an  included  colour.   R,G,B  sets the stencil colour.
  1684. HTol,STol,VTol sets the HSV tolerance range for the colour entry.
  1685.  
  1686.  
  1687.  
  1688.                 SetDrawMode
  1689.                 Usage: SetDrawMode DModeNum [Weight]
  1690.  
  1691. Set the current drawing mode.
  1692. DModeNum  must  be in the range 1 to 18 for built in modes and 19 to 22 for
  1693. spare  (loadable) modes.  'Weight' optionally sets the weight for the mode.
  1694. The  range  of 'Weight ' will vary depending on the mode.  The valid ranges
  1695. are  0  to 100, -50 to 50 or 1 to 31, depending on whether the mode takes a
  1696. normal range, split range or convolution window size.
  1697.  
  1698. e.g.
  1699.         SetDrawMode 6 50        /* Posterise at 50% */
  1700.  
  1701.  
  1702.  
  1703.                 SetPage
  1704.                 Usage: SetPage R G B
  1705.  
  1706. Set  the  current page to a solid colour, R,G and B specifies the colour to
  1707. be used.
  1708.  
  1709.  
  1710.  
  1711.                 SetPaper
  1712.                 Usage: SetPaper PaperName [Depth]
  1713.  
  1714. Set  the  paper type for the current page.  PaperName must be the name of a
  1715. file  in  the OpalPaint:PaperTypes directory.  Depth can be used to specify
  1716. the 'roughness' of the paper, the range for Depth is 0 to 100.
  1717.  
  1718. e.g.
  1719.         SetPaper RicePaper 50
  1720.  
  1721.  
  1722.  
  1723.                 SetPen
  1724.                 Usage: SetPen R G B
  1725.  
  1726. Set  the  current pen colour used for drawing.  This function is equivalent
  1727. to calling SetPot for the currently active paint pot.
  1728.  
  1729.  
  1730.  
  1731.                 SetPot
  1732.                 Usage: SetPot PotNum R G B
  1733.  
  1734. Set  the  colour  of  a paint pot entry.  PotNum must be in the range (1 to
  1735. 260).
  1736.  
  1737.  
  1738.  
  1739.                 SetPrefs
  1740.                 Usage: SetPrefs Prefs
  1741.  
  1742. Modify  the  preferences.   'Prefs' is a single integer value, see GetPrefs
  1743. for flag values.
  1744.  
  1745.  
  1746.  
  1747.                 SetSpare
  1748.                 Usage: SetSpare SpareNum DModeName [Weight]
  1749.  
  1750. Load a drawing mode into a 'spare mode' location.  DModeName is the name of
  1751. the  mode  to load, Weight can be used to set the mode weight and should be
  1752. in the range 0 to 100.
  1753.  
  1754. e.g.
  1755.         SetSpare 1 AddNoise
  1756.  
  1757. SpareNum must be in the range (1 to 4).
  1758.  
  1759.  
  1760.  
  1761.                 SetSten
  1762.                 Usage: SetSten
  1763.  
  1764. Set the mask stencil for the current image to a solid colour (all 1's). 
  1765.  
  1766.  
  1767.  
  1768.                 ShearH
  1769.                 Usage: ShearH Distance
  1770.  
  1771. Shear  the  current  cutout  brush  horizontally  by  the  number of pixels
  1772. specified by 'Distance'.
  1773.  
  1774.  
  1775.  
  1776.                 ShearV
  1777.                 Usage: ShearV Distance
  1778.  
  1779. Shear the current cutout brush vertically by the number of pixels specified
  1780. by 'Distance'.
  1781.  
  1782.  
  1783.  
  1784.                 SmoothPaper
  1785.                 Usage: SmoothPaper
  1786.  
  1787. Reset the paper type for the current page to smooth.
  1788.  
  1789.  
  1790.  
  1791.                 SolidEllipse
  1792.                 Usage: SolidEllipse Xc Yc a b
  1793.  
  1794. Draw  a  solid ellipse centered around Xc,Yc with a horizontal dimension of
  1795. 'a'  and  a vertical dimension of 'b'.  To draw a solid circle, set 'a' and
  1796. 'b' to the same value.
  1797.  
  1798.  
  1799.  
  1800.                 SolidFreeHand
  1801.                 Usage: SolidFreeHand [X Y X Y ...]
  1802.  
  1803. Start  Solid  FreeHand drawing mode.  If the vertices are given, lines will
  1804. be  drawn  to  the  given points.  Additional points can be given using the
  1805. Point  command,  and the freehand outline is terminated using the LastPoint
  1806. command.
  1807.  
  1808.  
  1809.  
  1810.                 SolidPoly
  1811.                 Usage: SolidPoly [X Y X Y ...]
  1812.  
  1813. Start  Solid  poly  drawing mode.  If the vertices are given, lines will be
  1814. drawn  to the given points.  Additional points can be given using the Point
  1815. command, and the polygon is terminated using the LastPoint command.
  1816.  
  1817.  
  1818.  
  1819.                 SolidRect
  1820.                 Usage: SolidRect X1 Y1 X2 Y2
  1821.  
  1822. Draw  a  solid rectangle between Point1 (X1,Y1) and Point2 (X2,Y2).  Point1
  1823. defines  the  top  left-hand  corner  of  the rectangle, Point2 defines the
  1824. bottom right-hand corner.
  1825.  
  1826.  
  1827.  
  1828.                 SpreadPots
  1829.                 Usage: SpreadPots Pot1 Pot2
  1830.  
  1831. Create  a spread of colour between Pot1 and Pot2.  Equivalent to the Spread
  1832. button in the Palette menu.  Pot1 and Pot2 must be in the range 1 to 260.
  1833.  
  1834.  
  1835.  
  1836.                 StenEnable
  1837.                 Usage: StenEnable Enable
  1838.  
  1839. This  is  the main stencil enable.  If 'Enable' is false (=0) stencils will
  1840. be  disabled,  else  stencils  are enabled.  This enables/disables both the
  1841. mask  and  colour stencils.  This control corresponds to the STEN gadget on
  1842. the main menu.
  1843.  
  1844.  
  1845.  
  1846.                 SwapPage
  1847.                 Usage: SwapPage SrcPageNum DestPageNum
  1848.  
  1849. Swaps  the  order  of  two pages, this simply reorders the pages in memory.
  1850. This is equivalent to the swap gadget in the spare page requester.
  1851.  
  1852.  
  1853.  
  1854.                 Texture
  1855.                 Usage: Texture Enable
  1856.  
  1857. The Enable argument can be either ENABLE (=1) or DISABLE (=0).
  1858.  
  1859.  
  1860.  
  1861.                 TextureType
  1862.                 Usage: TextureType Mode [Tile]
  1863.  
  1864. Set the current Texture modes. Valid values for mode are:
  1865.  
  1866.         BRUSH1          = Use brush 1 as texture.
  1867.         BRUSH2          = Use brush 2 as texture.
  1868.         BRUSH3          = Use brush 3 as texture.
  1869.         RUBTHROUGH      = Rubthrough mode.
  1870.         PANTOGRAPH      = Pantograph mode.
  1871.         CLONE           = Clone mode.
  1872.  
  1873. Allowable values for the Tile parameter are:
  1874.         TILE
  1875.         NOTILE
  1876.  
  1877.  
  1878.  
  1879.                 Trans
  1880.                 Usage: Trans Enable
  1881.  
  1882. The Enable argument can be either ENABLE (=1) or DISABLE (=0).
  1883.  
  1884.  
  1885.  
  1886.                 TransDither
  1887.                 Usage: TransDither Dither
  1888.  
  1889. Set  the dither level for the transparency gradient in the current gradient
  1890. pair.  Dither must be in the range 0 to 100.
  1891.  
  1892.  
  1893.  
  1894.                 TransEven
  1895.                 Usage: TransEven
  1896.  
  1897. Regularly  spaces  (evens  out)  the  transparency tags in the transparency
  1898. gradient  of  the  current  gradient  pair.  This is equivalent to the even
  1899. space gadget in the gradient menu.
  1900.  
  1901.  
  1902.  
  1903.                 TransGradTag
  1904.                 Usage: TransGradTag Position Trans
  1905.  
  1906. Adds  a  transparency  tag  to  the  transparency  gradient  in the current
  1907. gradient  pair.   Position  specifies  the  position  of the tag within the
  1908. gradient  where  0  corresponds  to the start of the gradient (left hand of
  1909. colour  bar  in  the  gradient  menu)  and  1 corresponds to the end of the
  1910. gradient  (right  hand side).  Trans sets the transparency of the tag (0 to
  1911. 100).
  1912.  
  1913. For  example  to  create a gradient from fully transparent through to solid
  1914. and back to fully transparent:
  1915.  
  1916.         ActiveGrad 5            /* Select the 5th gradient pair as active */
  1917.         TransGradTag  0    100
  1918.         TransGradTag  0.5 0
  1919.         TransGradTag  1    100
  1920.  
  1921.  
  1922.  
  1923.                 TransReverse
  1924.                 Usage: TransReverse
  1925.  
  1926. Reverses the direction of the transparency gradient in the current gradient
  1927. pair.  This is equivalent to the reverse gadget in the gradient menu.
  1928.  
  1929.  
  1930.  
  1931.                 TransType
  1932.                 Usage: TransType Type [Trans1 [Trans2 Trans3]]]
  1933.  
  1934. Set transparency options. Valid values for 'Type' are:
  1935.  
  1936.         STANDARD        = Standard
  1937.         RGB             = RGB Transparency
  1938.         HSV             = HSV Transparency
  1939.         ALPHA           = Alpha transparency.
  1940.  
  1941. The meaning of the tolerance values varies depending on the value of 'Type'. 
  1942. If Type is STANDARD, Tol1 sets the standard transparency value. 
  1943. If Type is RGB, then Tol1, Tol2 and Tol3 set the Red,Green and Blue transparencies respectively.
  1944. If Type is HSV, then Tol1, Tol2 and Tol3 set the Hue, Saturation and Value transparencies respectively.
  1945. If Type is ALPHA, then Tol1 sets the 'strength' of the alpha channel.
  1946.  
  1947.  
  1948.                 Undo
  1949.                 Usage: Undo
  1950.  
  1951. Undo  the  last  operation  if possible.  Note that the undo buffer will be
  1952. lost if the display view is paned or the magnification level is changed.
  1953.  
  1954.  
  1955.  
  1956.                 Version
  1957.                 Usage: Version
  1958.  
  1959. Return the version string for OpalPaint. The string will be of the form:
  1960.  
  1961.         $VER: OpalPaint 1.0 (14.10.92)
  1962.  
  1963.  
  1964.  
  1965.                 VideoMode
  1966.                 Usage: VideoMode
  1967.  
  1968. This  command  is  used to determine whether OpalPaint is running in PAL or
  1969. NTSC mode.  The returned value will be either 'PAL' or 'NTSC'.
  1970.  
  1971.  
  1972.  
  1973.                 WarpBrush
  1974.                 Usage: WarpBrush BrushNum
  1975.  
  1976. Set  the brush number used in the Warp/Fill mode.  This command corresponds
  1977. to the brush gadgets in the fill menu.  BrushNum must be in the range (1 to
  1978. 3).
  1979.  
  1980.  
  1981.  
  1982.                 WarpFactor
  1983.                 Usage: WarpFactor Factor
  1984.  
  1985. Set the warp factor used in brush fill mode.  Factor must be in the range 0
  1986. to 100.
  1987.  
  1988.  
  1989.  
  1990.                 WorkMode
  1991.                 Usage: WorkMode WMode
  1992.  
  1993. Set the current work mode. 'WMode' can be:
  1994.  
  1995.         IMAGE     = Image edit mode
  1996.         STENCIL   = Stencil edit mode
  1997.         ALPHA     = Alpha edit mode
  1998.  
  1999. This command corresponds to the work mode gadgets on the main menu.
  2000.  
  2001.  
  2002.  
  2003.                 Zap
  2004.                 Usage: Zap
  2005.  
  2006. Zap the current page.
  2007.  
  2008.  
  2009.  
  2010.  
  2011.                         Example Script  - Bevelled Box.
  2012.  
  2013. /* Draw a bevelled drop box using OpalPaint.
  2014.  */
  2015.  
  2016. address 'OpalPaint_Rexx'
  2017.  
  2018. options Results
  2019.  
  2020. SaveSetUp
  2021. GetRect
  2022. parse var Result X1  Y1  X2  Y2
  2023.  
  2024. Depth = 10              /* Could use AskInt here */
  2025.  
  2026. GetPen
  2027. RGBtoHSV Result
  2028. Parse var Result Hue Sat Val
  2029.  
  2030. /* Box body. Set up a diagonal HSV gradient */
  2031.  
  2032. FillMode Gradient
  2033. ClearColGrad
  2034. ClearTransGrad
  2035. ColourDither 0
  2036. TransDither 0
  2037.  
  2038. HSVtoRGB Hue Sat Val
  2039. ColGradTag 0 Result
  2040. S2 = (Sat-(0.4*65535))%1 /* Note: %1 converts number to an integer */
  2041. S2 = MAX(S2,0)  
  2042. HSVtoRGB Hue S2 Val
  2043. ColGradTag 0.5 Result
  2044. HSVtoRGB Hue Sat Val
  2045. ColGradTag 1 Result
  2046. GradType LinearFree HSV
  2047. GradRange X1+Depth Y1+Depth X2-Depth Y2-Depth
  2048. SolidRect X1+Depth Y1+Depth X2-Depth Y2-Depth
  2049.  
  2050. FillMode Solid
  2051.  
  2052. /* Top */
  2053.  
  2054. V2 = (Val+0.1*65535)%1
  2055. V2 = MIN(V2,65535)
  2056.  
  2057. HSVtoRGB Hue Sat V2
  2058. SetPen Result
  2059.  
  2060. SolidPoly X1 Y1 X2 Y1 X2-Depth Y1+Depth X1+Depth Y1+Depth X1 Y1
  2061. LastPoint
  2062.  
  2063.  
  2064. /* Right */
  2065.  
  2066. V2 = (Val-0.15*65535)%1
  2067. V2 = MAX(V2,0)
  2068.  
  2069. HSVtoRGB Hue Sat V2
  2070. SetPen Result
  2071.  
  2072. SolidPoly X2 Y1 X2 Y2 X2-Depth Y2-Depth X2-Depth Y1+Depth X2 Y1
  2073. LastPoint
  2074.  
  2075. /* Left */
  2076.  
  2077. V2 = (Val+0.15*65535)%1
  2078. V2 = MIN(V2,65535)
  2079.  
  2080. HSVtoRGB Hue Sat V2
  2081. SetPen Result
  2082.  
  2083. SolidPoly X1 Y1 X1+Depth Y1+Depth X1+Depth Y2-Depth X1 Y2 X1 Y1
  2084. LastPoint
  2085.  
  2086. /* Bottom */
  2087.  
  2088. V2 = (Val-0.1*65535)%1
  2089. V2 = MAX(V2,0)
  2090.  
  2091. HSVtoRGB Hue Sat V2
  2092. SetPen Result
  2093.  
  2094. SolidPoly X2 Y2 X1 Y2 X1+Depth Y2-Depth X2-Depth Y2-Depth X2 Y2
  2095. LastPoint
  2096. RestoreSetUp
  2097.  
  2098.